package com.ayoka.adapter;

import com.ayoka.R;
import com.ayoka.mvp.PurchaseRecordMVP.PurchaseRecordModel.PurchaseRecordBean;
import com.jcp.baselibrary.brvah.BaseQuickAdapter;
import com.jcp.baselibrary.brvah.BaseViewHolder;
import com.jcp.baselibrary.utils.StringUtil;

import java.util.List;

/**
 * Created by jinchunping on 2018/4/11.
 */

public class PurchaseRecordAdapter extends BaseQuickAdapter<PurchaseRecordBean, BaseViewHolder> {

    public PurchaseRecordAdapter() {
        super(R.layout.item_purchase_record, null);
    }

    @Override
    protected void convert(BaseViewHolder holder, PurchaseRecordBean item) {
        holder.setText(R.id.tv_record_title, item.Descp)
                .setText(R.id.tv_purchase_price, StringUtil.formatString(R.string.format_price_adjust, (int)item.total_fee))
                .setText(R.id.tv_purchase_date, StringUtil.formatString(R.string.format_purchase_date, item.CreateDate))
                .setText(R.id.tv_expiry_date, StringUtil.formatString(R.string.format_expiry_date, "2019.02.25-2020.02.25"))
                .setVisible(R.id.tv_expiry_date, false)
                .setText(R.id.tv_order_code, StringUtil.formatString(R.string.format_order_code, item.TradeCode));
    }
}
